<?php
/*
	提现
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
global $_RQ;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$area_agent=$this->get('area_agent',array('mid'=>$_SESSION['uid']));
if($_RQ['op']=='get'){
	$return['pluginset']=$this->plugin_setting('areasetting');
	$member=pdo_get('core_members',array('id'=>$_SESSION['uid']));
	$daytime = mktime(0,0,0,date('m'),date('d'),date('Y'));
	$data['allmoney']=pdo_getsum('jy_weishop_store_commission',array('storeid'=>$area_agent['storeid']),'total_price');
	$data['commission_total']=pdo_getsum('jy_weishop_store_commission',array('storeid'=>$area_agent['storeid']),'money');
	$data['daifee']=pdo_getsum('jy_weishop_store_commission',array('status'=>1,'storeid'=>$area_agent['storeid'],'createtime >'=>$daytime),'money');
	$data['dayfee']=pdo_getsum('jy_weishop_store_commission',array('storeid'=>$area_agent['storeid'],'createtime >'=>$daytime),'total_price');
	$data['tixian']=$member['credit2'];
	$return['data']=$data;
	$return['member']=$member;
	$return['params']['type']=$_RQ['type']?:2;
	if($this->setting['withdrawtype']){
		$withdrawtype=array();
		$check=strstr($this->setting['withdrawtype'],'credit');
		if($check){
			$withdrawtype['credit']=$this->pay_types['credit'];
			$pay_type='credit';
		}
		$check=strstr($this->setting['withdrawtype'],'wechat');
		if($check){
			$withdrawtype['wechat']=$this->pay_types['wechat'];
			$pay_type=$pay_type?:'wechat';
		}
		$check=strstr($this->setting['withdrawtype'],'alipay');
		if($check){
			$withdrawtype['alipay']=$this->pay_types['alipay'];
			$pay_type=$pay_type?:'alipay';
		}
		$check=strstr($this->setting['withdrawtype'],'union');
		if($check){
			$withdrawtype['union']=$this->pay_types['union'];
			$pay_type=$pay_type?:'union';
		}
		$return['pay_types']=$withdrawtype;
	}else{
		$return['pay_types']=$this->pay_types;
		$pay_type='credit';
	}
	$return['post']=array('pay_type'=>$pay_type);
	set_html('title','我的业绩');
	exi($return);
}